<?
if (!defined('MODULE_FILE')){
die ("cant access file directly!");
}
$mid2=$_GET['mid'];//echo $mid2;
$level_id=1;
?>
<?
$id=$_GET['id'];
$sql=mysql_query("select * from users where id='$id'");
$row=mysql_fetch_array($sql);
?>
<?php require_once 'commonJS.php'; ?>
<script>
    $(document).ready(function(){
                   $( "#from" ).datepicker({
                        dateFormat: 'yy-mm-dd',
                        showOn: "button",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: true,
                        changeMonth: true,
                        changeYear: true,
                        yearRange: "-30"
                   });
              });
</script>
<script>
    $(document).ready(function(){
                   $( "#to" ).datepicker({
                        dateFormat: 'yy-mm-dd',
                        showOn: "button",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: true,
                        changeMonth: true,
                        changeYear: true,
                        yearRange: "-30"
                   });
              });
</script>
</br>
<div class="col-lg-8">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-bell fa-fw"></i>User Details:</div>
<div class="panel-body">
<div class="table-responsive">
<form action="modules.php?file=user_update&mid=<? echo $mid2; ?>&smid=<? echo $smid; ?>" method="POST" id="formSubmit">
<table >
<tbody>
 <tr> <td valign=top width="15%">Name :</td>
<td>
    <input type="text" class="validate[required]" name="name" id="name" size="25" value="<?php echo $row['Name']?>">
</td>
</tr>
<tr><td colspan="2" height="10px"></td></tr>
<tr><td >Email Id:</td>
<td><input type="text" class="validate[required]" name="email" id="email" value="<?php echo $row['Email']?>" size="25"/></td></tr>
<tr><td colspan="2" height="10px"></td></tr>
<tr>
<td>Login:</td>
<td>
	<input type="text" class="validate[required]" name="login" id="login" value="<?php echo $row['Login']?>"/>
</td>
</tr>
<tr><td colspan="2" height="10px"></td></tr>
<tr>  
<td>Password:</td>
<td><input type="password" class="validate[required]" name="password" id="password" value=""/></td>
</tr>
<tr><td colspan="2" height="10px"></td></tr>
<tr valign="top">
				<td  width="170">Department</td>
			    <td>
				<select name="dept" id="dept" style="width:202px;" class="validate[required]">
						<option value=""> -- please choose -- </option>
						<?
						$query15 = "select * from dept_master";
						$res1 = mysql_query($query15);
						while($d1=mysql_fetch_array($res1))
						{
						?>
						<option value="<?=$d1['dept_id']?>" <?if($d1['dept_id']==$row['department']){echo "selected";}?>><?=$d1['department_name']?></option>
						<?}?>
				</select>
				</td>
			</tr>
			<tr>
				<td colspan="2" height="10px"></td>
			</tr>
			<tr valign="top">
				<td  width="170">Reporting Manager</td>
				<td>
				<select name="reportmgr" id="reportmgr" style="width:202px;" class="validate[required]">
						<option value=""> -- please choose -- </option>
						<?
						$query16 = "select * from users";
						$res2 = mysql_query($query16);
						while($d2=mysql_fetch_array($res2))
						{
						?>
						<option value="<?=$d2['id']?>" <?if($d2['id']==$row['reporting_mgr']){echo "selected";}?>><?=$d2['Name']?></option>
						<?}?>
				</select>
				</td>
			</tr>
         	<tr>
				<td colspan="2" height="10px"></td>
			</tr>
			<tr valign="top">
				<td  width="170">Date Of Joining</td>
				<td><input  value="" class="validate[required]" readonly type="text" name="from" id="from" style="width:202px;"></td>
			</tr>
			
			<tr><td colspan="2" height="10px"></td></tr>
         	<tr valign="top">
				<td  width="170">Date Of Leaving</td>
				<td><input  value="" class="validate[required]" readonly type="text" name="to" id="to" style="width:202px;"></td>
			</tr>
			<tr>
				<td colspan="2" height="10px"></td>
			</tr>
			<tr valign="top">
				<td width="170">Tenure</td>
				<td><input id="tenure" class="validate[required]" Name="tenure" type="text" class="FormInput" style="width:202px;" value="<?php echo $row['tenure']?>"></td>
			</tr>
			<tr>
				<td colspan="2" height="10px"></td>
			</tr>
			<tr valign="top">
				<td width="170">Billing Status</td>
				<td>
				<select name="billsts" id="billsts" style="width:202px;" class="validate[required]">
				<option value=''>-Select-</option>
				<option value='1' <?if($row['billing_status']==1){echo "selected";}?>>Billable</option>
				<option value='2' <?if($row['billing_status']==2){echo "selected";}?>>Non Billable</option>
				</select>
				</td>
			</tr>
			<tr>
				<td colspan="2" height="10px"></td>
			</tr>
			<tr valign="top">
				<td width="170">Employee Status</td>
				<td>
				<select name="empsts" id="empsts" style="width:202px;" class="validate[required]">
				<option value=''>-Select-</option>
				<option value='0' <?if($row['emp_status']==0){echo "selected";}?>>Active</option>
				<option value='1' <?if($row['emp_status']==1){echo "selected";}?>>Not Active</option>
				</select>
				</td>
			</tr>
			<tr>
				<td colspan="2" height="10px"></td>
			</tr>
			<tr valign="top">
				<td width="170">Total PL</td>
				<td><input id="totpl" Name="totpl" type="text" class="FormInput" style="width:100px;" value=""></td>
			</tr>
			<tr>
				<td colspan="2" height="10px"></td>
			</tr>
			<tr valign="top">
				<td width="170">Total CL</td>
				<td><input id="totcl" Name="totcl" type="text" class="FormInput" style="width:100px;" value=""></td>
			</tr>
<tr><td><input type="hidden" name="uid" value="<? echo $id; ?>" size="8"/></td>
<td><input type="submit" name="Submit" value="Submit"></td></tr>
</table>
</form>
</div>	
</div>	
</div>	
</div>	